# coding: utf-8
"""
@Time    : 2020/5/28 20:34
@Author  : VillageTony
@FileName: spider.py
@Software: PyCharm
@Blog    ：https://www.diaoyc.cn/
"""
import sys
from Crawldata.dboperation.DbOperation import DbOperation

le = len(sys.argv)
s = """
    参数说明：
    请输入参数：
    in_his    调用inset_history     获取历史数据
    up_his    调用update_history    更新历史记录 
    up_hot    调用update_hotsearch  更新实时热搜
    up_det    调用update_details    更新每日详情
    """
if le == 1:
    print(s)
else:
    order = sys.argv[1]
    if order == "in_his":
        DbOperation().inset_history()
    elif order == "up_his":
        DbOperation().update_history()
    elif order == "up_hot":
        DbOperation().update_hotsearch()
    elif order == "up_det":
        DbOperation().update_details()
    else:
        print("参数不正确！ " + s)
